# Contributor: Leo <thinkabit.ukim@gmail.com>
# Maintainer: Celeste <cielesti@protonmail.com>
pkgname=b3sum
pkgver=1.5.1
pkgrel=0
pkgdesc="Command line implementation of the BLAKE3 hash function"
url="https://github.com/BLAKE3-team/BLAKE3"
arch="all"
license="CC0-1.0 OR Apache-2.0"
makedepends="cargo cargo-auditable"
source="$pkgname-$pkgver.tar.gz::https://crates.io/api/v1/crates/b3sum/$pkgver/download"

case "$CARCH" in
armhf)
	# hang forever, probably due to non-native hardware
	options="$options !check"
	;;
aarch64|armv7)
	_features="neon"
	;;
esac


prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --release --frozen ${_features:+--features $_features}
}

check() {
	cargo test --frozen ${_features:+--features $_features}
}

package() {
	install -Dm755 target/release/b3sum -t "$pkgdir"/usr/bin
}

sha512sums="
13108cee43f416ff1f2ff62be69e49fcb463b5816aef8e30120e6e238ce5527dac4b5fe505262b880dfda179dfb0e09179cd663f3a150af49e8d864a6597d5f0  b3sum-1.5.1.tar.gz
"
